package com.adlx.dingdong.mall.controller.v1;

import com.adlx.dingdong.mall.controller.BaseController;
import com.adlx.dingdong.mall.client.ProductClient;
//import com.github.pagehelper.PageInfo;
import com.adlx.dingdong.mall.dto.Result;
import com.adlx.dingdong.mall.dto.ShopGoodsDTO;
import com.adlx.dingdong.mall.vo.ShopGoodsVO;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by administrator on 18/8/31
 */
@RestController
@RequestMapping(value = {"/v1/product"})
public class ProductController extends BaseController {


    @Autowired
    private ProductClient productClient;


    @RequestMapping(value = "list", method = RequestMethod.GET)
    public Result<PageInfo> getList(ShopGoodsDTO shopGoodsDTO) {
        PageInfo<List<ShopGoodsVO>> pageInfo = productClient.getList(shopGoodsDTO);
        return Result.success(pageInfo);
    }

//
//    @RequestMapping(value = "filter", method = RequestMethod.GET)
//    public Result<PageInfo> filter(ShopGoodsDTO shopGoodsDTO) {
//        PageInfo<List<ShopGoodsVO>> pageInfo = productClient.getList(shopGoodsDTO);
//        return Result.success(pageInfo);
//    }

}
